package com.mindata.blockchain.core.manager;

import com.mindata.blockchain.core.model.OrderEntity;
import com.mindata.blockchain.core.repository.OrderRepository;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 王鹏
 */
@Component
public class OrderManager {

    @Resource
    private OrderRepository orderRepository;

    public List<OrderEntity> getAllEntity() {
        return orderRepository.findAll();
    }

    public List<OrderEntity> getOrderBySceneryName(String sceneryName) {
        return orderRepository.findBySceneryName(sceneryName);
    }


    public OrderEntity findByTicketId(String ticketId) {
        return orderRepository.findByTicketId(ticketId);
    }

    public OrderEntity findByOrderId(String orderId) {
        return orderRepository.findByOrderId(orderId);
    }


}
